package com.atguigu.scala.chapter8

import scala.util.Random

/**
 * @author lizikuan
 * @date 2021/5/25 18:06
 */
object $03_MatchValue {
  def main(args: Array[String]): Unit = {
    val list = Array("hello", 10, 99.9, "world", "lol")
    val index = Random.nextInt(list.length)
    val value: Any = list(index)
    println(value)
    val Wo = "world"
    value match {
      case "hello" => println("hello...")
      case 10 => println("10...")
      case 99.9 => println("99.9...")
      case Wo => println("world...")
      case "lol" => println("lol......")
    }
  }
}

